<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>Document</title>
  <style>
    body {
      margin: 0;
      padding: 0;
      perspective: 1000px;
    }
    .box {
      position: relative;
      width: 300px;
      height: 200px;
      margin: 200px auto 50px;
      background: url(img/img-1.jpg) no-repeat;
      background-size: cover;
      transform-style: preserve-3d;
      transition: 5s linear;
      animation: boxrotate 10s linear infinite;
    }
    /* .box:hover {
      transform: rotateY(360deg);
      animation-play-state: paused;
    } */
    @keyframes boxrotate {
      from {
        transform: rotateY(0deg);
      }
      to {
        transform: rotateY(360deg);
      }
    }
    .box div {
      position: absolute;
      width: 100%;
      height: 100%;
      background: url(img/dog.gif) no-repeat;
      background-size: cover;
    }
    .box div:nth-child(1) {
      transform: rotateY(0deg) translateZ(300px);
    }
    .box div:nth-child(2) {
      transform: rotateY(60deg) translateZ(300px);
    }
    .box div:nth-child(3) {
      transform: rotateY(120deg) translateZ(300px);
    }
    .box div:nth-child(4) {
      transform: rotateY(180deg) translateZ(300px);
    }
    .box div:nth-child(5) {
      transform: rotateY(240deg) translateZ(300px);
    }
    .box div:nth-child(6) {
      transform: rotateY(300deg) translateZ(300px);
    }
    .btn {
      width: 100px;
      margin: auto;
    }
  </style>
</head>
<body>
  <div class="box">
    <div></div>
    <div></div>
    <div></div>
    <div></div>
    <div></div>
    <div></div>
  </div>
  <div class="btn">
    <input type="button" value="暂停" id="btn1">
    <input type="button" value="继续" id="btn2">
  </div>
  <script>
    var pause = document.getElementById('btn1');
    var conti = document.getElementById('btn2');
    var div = document.getElementsByTagName('div')[0];
    pause.onclick = function () {
      div.style.animationPlayState = 'paused';
    }
    conti.onclick = function () {
      div.style.animationPlayState = 'running';
    }
  </script>
</body>
</html>